<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template match="/">
		<table border="0" widht="700px">
			
			<tr>
				<td width="25%" align="left" STYLE="FONT-SIZE:10PT;" >Market Complaint ID : </td>
				<td width="75%" STYLE="FONT-SIZE:10PT;">
					<span STYLE="FONT-SIZE:10PT;float:right;">
						Site Code :
						<xsl:value-of select="doc/field[@name='site_code']"/>
					</span>
					<xsl:value-of select="doc/field[@name='primary_value']"/>
				</td>
			</tr>
			<tr>
				<td width="25%" align="left" STYLE="FONT-SIZE:10PT;">Complaint Description :  </td>
				<td width="75%" STYLE="FONT-SIZE:10PT;"><xsl:value-of select="doc/field[@name='comp_descr']"/></td>
			</tr>
			<tr>
				<td width="25%" align="left" STYLE="FONT-SIZE:10PT;">Complaint recieved Form :  </td>
				<td width="75%" STYLE="FONT-SIZE:10PT;"><xsl:value-of select="doc/field[@name='recv_from__entity']"/></td>
			</tr>
			<tr>
				<td width="25%" align="left" STYLE="FONT-SIZE:10PT;">Complaint Status :  </td>
					<xsl:variable name="status"><xsl:value-of select="doc/field[@name='complaint_status']"/></xsl:variable>
					<xsl:choose>
						<xsl:when test="$status = 'C'">
							<td width="75%" STYLE="FONT-SIZE:10PT">Close</td>
						</xsl:when>
						<xsl:when test="$status = 'O'">
							<td width="75%" STYLE="FONT-SIZE:10PT">Open</td>
						</xsl:when>
						<xsl:when test="$status = 'D'">
							<td width="75%" STYLE="FONT-SIZE:10PT">Draft</td>
						</xsl:when>
						<xsl:when test="$status = 'R'">
							<td width="75%" STYLE="FONT-SIZE:10PT">Rejected</td>
						</xsl:when>
					</xsl:choose>
			</tr>	
		</table>
		
	</xsl:template>
</xsl:stylesheet>
